package flca.osm.perst.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.garret.perst.Persistent;

public class PWay extends Persistent
{
	private int id;
	private List<Integer> wayNodes = new ArrayList<Integer>();
	private Map<String, String> tags = new HashMap<String, String>();
	
	
	public PWay(int id) {
		super();
		this.id = id;
	}

	public PWay(int id, List<Integer> wayNodes, Map<String, String> tags) {
		super();
		this.id = id;
		this.wayNodes = wayNodes;
		this.tags = tags;
	}

	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}


	public List<Integer> getWayNodes() {
		return wayNodes;
	}


	public void setWayNodes(List<Integer> wayNodes) {
		this.wayNodes = wayNodes;
	}


	public Map<String, String> getTags() {
		return tags;
	}


	public void setTags(Map<String, String> tags) {
		this.tags = tags;
	}
	
	public void addWayNode(Integer aRef) {
		wayNodes.add(aRef);
	}

	public void addWayNode(int aRef) {
		wayNodes.add(new Integer(aRef));
	}

	public void addWayTag(String aKey, String aValue) {
		tags.put(aKey,  aValue);
	}


	@Override
	public String toString() {
		return "MyWay [id=" + id + "nNodes=" + wayNodes.size() + "]";
	}
	
	
}
